package com.designed.pattern.creational.factorymethod;

import com.designed.pattern.creational.factorymethod.core.*;
import com.designed.pattern.creational.factorymethod.core.Operation;

/**
 * @author yifei
 * @date 2024/3/28
 **/
public class FactoryBasic implements IFactory{
    @Override
    public Operation createOperation(String operType) {
        Operation oper = null;
        switch (operType){
            case "+":
                oper = new Add();
                break;
            case "-":
                oper = new Sub();
                break;
            case "*":
                oper = new Mul();
                break;
            case "/":
                oper = new Div();
        }
        return oper;
    }
}
